(function(){
	com.hp.demo.vteam.components.ModifyAccountManager = Ext.extend(Ext.form.FormPanel,{		
		initComponent:function()
		{
			var record = this.params.accountManager;
			Ext.apply(this,{
				flex:1,
				fullscreen:true,
                defaults: { labelWidth:'8em', },
				items:[
						{
							xtype:'textfield',							
							name:'name',
							label:com.hp.demo.vteam.dict.FIELDS.ACCOUNT_MANAGER_NAME,
							value:record.get('name')
						},
						{
							xtype:'ajaxselect',
							valueField:"id",
							displayField:'name',
							name:'accountGroupId',
							store:com.hp.demo.vteam.base.QuerySelectStore({
								url:com.hp.demo.vteam.dict.REQUEST.AccountGroup,
								model:'AccountGroup',
								errorMsg:com.hp.demo.vteam.dict.ERRORS.QUERY_ACCOUNT_GROUP_SYS
							}),
							label:com.hp.demo.vteam.dict.FIELDS.ACCOUNT_GROUP_NAME,
							value:record.get('id')
						},{
	                        xtype: 'fieldset',
	                        title: com.hp.demo.vteam.dict.FIELDS.ACCOUNT_MANAGER_GENDER,
	                        defaults: { xtype: 'radiofield', labelWidth:'8em'},
	                        items: [
	                        { 						
	    						name : 'gender', 
	    						label: '男',
	    						value : '男' 
	    					}, { 
	    						name : 'gender', 
	    						label: '女' , 
	    						value : '女'
	    					}]
	                    },
						{
	                        xtype: 'emailfield',
	                        name : 'workEmail',
							label:com.hp.demo.vteam.dict.FIELDS.ACCOUNT_MANAGER_WORKEMAIL,
	                        useClearIcon: true,
	                        value:record.get('workEmail')
	                    },
						{
							xtype:'textfield',
							name:'tel',
							label:com.hp.demo.vteam.dict.FIELDS.ACCOUNT_MANAGER_TEL,
							value:record.get('tel')
						},
						{
							xtype:'textfield',
							name:'mobile',
							label:com.hp.demo.vteam.dict.FIELDS.ACCOUNT_MANAGER_MOBILE,
							value:record.get('mobile')
						},
						{
							xtype:'textareafield',
							labelAlign:'top',
							labelWidth:'100%',
							desc:'desc',
							label:com.hp.demo.vteam.dict.FIELDS.ACCOUNT_MANAGER_DESC,
							value:record.get('desc')
						}
					],
				dockedItems:{
					xtype:'toolbar',
					dock:'bottom',
					items:[
						{xtype:'spacer'},
						{
							xtype:'button',
							scope:this,
							text:com.hp.demo.vteam.dict.ITEM.save,
							handler:function()
							{
								com.hp.demo.vteam.base.status_msg(com.hp.demo.vteam.dict.SUCCESSES.SAVE_BEGIN);
								this.submit({
									url:com.hp.demo.vteam.dict.REQUEST.AccountManager,
									method:'post',
									params:{method:'edit',id:record.get('id')},
									success:function(f,r){
										//com.hp.demo.vteam.base.status_msg(com.hp.demo.vteam.dict.SUCCESSES.MODIFY_INFO_KIND);
										setTimeout(function(){
											com.hp.demo.vteam.base.Action(com.hp.demo.vteam.dict.ID.ACCOUNT_MANAGER,com.hp.demo.vteam.dict.SUCCESSES.MODIFY_ACCOUNT_MANAGER);
										},1000);
									},
									failure:function(f,r){
										if(r.status!=200)
										{
											com.hp.demo.vteam.base.status_msg(com.hp.demo.vteam.dict.ERRORS.MODIFY_ACCOUNT_MANAGER_SYS);
										}
										else
										{
											var jRlt = Ext.decode(r.responseText);
											com.hp.demo.vteam.base.status_msg(com.hp.demo.vteam.dict.ERRORS.MODIFY_ACCOUNT_MANAGER + '[' + jRlt.msg + ']!');
										}
									}
								});
							}
						}
					]
				}
			});
			com.hp.demo.vteam.components.ModifyAccountManager.superclass.initComponent.call(this);
		}
	});
	return com.hp.demo.vteam.components.ModifyAccountManager;
})();